package com.google.code.mircle.plugins.subscriptions;

import java.io.File;

import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;

import com.google.code.mircle.core.Model;
import com.google.code.mircle.core.Plugin;
import com.google.code.mircle.core.Root;
import com.google.code.mircle.core.View;

public class SubscriptionsPlugin implements Plugin, Root {

    public SubscriptionsPlugin() {
    }

    public String getName() {
        return "Subscriptions";
    }

    public void close() {

    }

    public Model[] getModels() {
        return new Model[] { new RSSModel("Youtube Animals Channel"), new RSSModel("Site RSS Video Feed"),
                new RSSModel("My Audio Blog RSS"), new EchoMskRSSModel("Escho.Msk.Program Buggly RSS feeds") };
    }

    public JPopupMenu contextMenu(Model m) {
        JPopupMenu popup = new JPopupMenu();
        popup.add(new JMenuItem("123"));
        return popup;
    }

    public View createView(Model m) {
        if (m instanceof RSSModel)
            return new RSSView((RSSModel) m);
        if (m instanceof EchoMskRSSModel)
            return new EchoMskRSSView((EchoMskRSSModel) m);
        return null;
    }

    @Override
    public void save(File path) {
        // TODO Auto-generated method stub

    }

    @Override
    public void load(File path) {
        // TODO Auto-generated method stub

    }

}
